import formDesigner from "./formDesigner.vue";
import fancyEditor from "./extend/fancyEditor.vue";
import fancyHtml from "./extend/fancyHtml.vue";
import fancyText from "./extend/fancyText.vue";
import fancyBarCode from "vue-barcode";
import fancyDialogList from "./extend/fancyDialogList.vue";
import iconDialog from "./iconDialog.vue";
// 新增常用组件
import valueText from "./extend/valueText";
import numInput from "./extend/numInput";
import formImage from "./extend/formImage";
// 自定义用户组件
import userDeptArray from "./extend/userDeptArray.vue";
import userListArray from "./extend/userListArray.vue";
import flowListArray from "./extend/flowListArray";
import signatureArray from "./extend/signatureArray.vue";

const plugins = {
  install: function (Vue) {
    Vue.component("form-designer", formDesigner);
    Vue.component("fancy-editor", fancyEditor);
    Vue.component("fancy-html", fancyHtml);
    Vue.component("fancy-text", fancyText);
    Vue.component("fancy-bar-code", fancyBarCode);
    Vue.component("fancy-dialog-list", fancyDialogList);
    Vue.component("icon-dialog", iconDialog);

    Vue.component("value-text", valueText);
    Vue.component("num-input", numInput);
    Vue.component("form-image", formImage);

    Vue.component("fancy-userDept-list", userDeptArray);
    Vue.component("fancy-user-list", userListArray);
    Vue.component("fancy-flow-list", flowListArray);
    Vue.component("fancy-signature-list", signatureArray);
  },
};
// 这一步判断window.Vue是否存在，因为直接引用vue.min.js， 它会把Vue绑到Window上，我们直接引用打包好的js才能正常跑起来。
if (typeof window !== "undefined" && window.Vue) {
  window.Vue.use(plugins);
}
export default plugins;
